<?php


    // Author: Tomasz Durka
    // Creation date: 15th August 2009
    // Prints out Javascript code
    
    
  function js_remove_element($element, $prefix = '') {
  
    ### if set to true, setting prefix 'parent.' used for calls from iframe
    
    
    if (is_object($element) && get_parent_class($element) == 'ActiveRecord') {
      $id = strtolower(get_class($element)) . '_entry_' . $element->id;
    } else {
      $id = $element;
    }
    
    $code = "{$prefix}$('{$id}').remove();";
    
    return js_query ($code);
  }

?>